package com.example.java.escape.thread;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * @author : weicai
 * @date : 15:28 2020/11/28
 * 拒绝策略
 */

    public class UserRejectHandler implements RejectedExecutionHandler {

        @Override
        public void rejectedExecution(Runnable task, ThreadPoolExecutor executor) {
            System.out.println("task rejected. " +executor.toString());
        }
    }

